import {
  request
} from '../utils/request';

// 活动列表
const activityList = (pageNum, pageSize, keyWord) => {
  return request({
    url: '/activity/list',
    data: {
      pageNum: pageNum,
      pageSize: pageSize,
      keyWord: keyWord
    }
  });
}

// 活动详情
const activityDetails = (activityId) => {
  return request({
    url: `/activity/${activityId}`
  });
}

// 提交报名
const signUp = (activityId, data = {}) => {
  return request({
    url: `/order/submit/${activityId}`,
    method: 'POST',
    data: data
  });
}

// 订单支付
const payment = (orderNo) => {
  return request({
    url: `/order/pay/${orderNo}`
  });
}

// 订单查询
const orderInquiry = (orderNo) => {
  return request({
    url: `/order/query/${orderNo}`
  });
}

module.exports = {
  activityList,
  activityDetails,
  signUp,
  payment,
  orderInquiry
}